#ifndef MAPBUBBLE_H_
#define MAPBUBBLE_H_

#include <e32base.h>
#include "mapactionlistener.h"
#include "maplistener.h"
#include "rectf.h"
#include "bubbleuser.h"
#include "custombubble.h"

class MapBubble : public MapActionListener, public MapListener
	{
private:
	static MapBubble* 				instance;
	TBool 							adjustable;
	RectF 							bound;

	TBool 							isOtherBubblesOnTop;
	TBool							isPressed;
	TBool							isVisible;

	RPointerArray<CustomBubble> 	otherBubbles;
	BubbleUser* 					user;

public:
	static MapBubble& GetInstance();
	~MapBubble();
	MapBubble();
	BubbleUser* GetUser() const;
	TBool IsVisible() const;
	
	// MapActionListener
	virtual TBool OnDoubleTapMap(const MotionEvent& paramMotionEvent);
	virtual TBool OnFlingMap(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2,
            float paramFloat1, float paramFloat2);
    virtual TBool OnLongPressMap(const MotionEvent& event);
    virtual TBool OnOriginalTouchEvent(const MotionEvent& event);
    virtual TBool OnScrollMap(const MotionEvent& event1,const MotionEvent& event2, float paramFloat1, float paramFloat2);
    virtual TBool OnSingleTapMap(const MotionEvent& event);
    virtual TBool OnSingleTapMapUnhandled(const MotionEvent& event);
    virtual TBool OnTouchMap(const MotionEvent& event);
    virtual TBool OnUpFromMap(const MotionEvent& event);
	
    // MapListener
    virtual void OnMapDrawn(CGraphicsContext& canvas);
    virtual void OnMapMoved(int paramInt1, int paramInt2);
    virtual void OnMapZoomChange(int zm, int nzm);

    void RegisterOtherBubble(CustomBubble& customBubble);
    void Reset(BubbleUser& bubbleUser, TBool flag);
    void SetOtherBubblesOnTop(TBool flag);
    void SetVisible(TBool flag);
    void UnregisterOtherBubble(CustomBubble& customBubble);
	};

#endif /* MAPBUBBLE_H_ */
